gethot();

function gethot() {
  console.log("获取热搜数据");
  $.ajax({
    url: "/weibo/blog/getHotSearchBlog",
    type: "get",
    success: function (result) {
      console.log(result);
      let hot = document.querySelector(".allHotList");
      hot.innerHTML = "";
      for (let i = 0; i < 10; i++) {
        hot.innerHTML =
          hot.innerHTML +
          ` <div class="hot-list">
        <span class="rank${i + 1}">${
            i + 1
          }</span><a href="/weibo/blog/skipToBlog?label=${result[i]}">${
            result[i]
          }</a>
        </div>`;
      }
      hot.innerHTML += `<a href="/weibo/blog/getHotBlog" class="all-hot"><div>查看完整榜单</div></a>`;
    },
    error: function (result) {
      console.log(result);
    },
  });
}
// 刷新热搜数据
let refresh = document.querySelector(".refresh");
refresh.onclick = function () {
  gethot();
};
